<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%
		//定义一个sessioncounter计数器
		Integer sessioncounter = (Integer)session.getAttribute("sessioncounter");
		if(sessioncounter==null)
			session.setAttribute("sessioncounter", 0);
		//定义一个applicationcounter计数器
		Integer applicationcounter = (Integer)application.getAttribute("applicationcounter");
		if(applicationcounter==null)
			application.setAttribute("applicationcounter", 0);
	 %>
<title>Insert title here</title>
</head>
<body>
	<%
		//把session中的计数器+1
		sessioncounter = (Integer)session.getAttribute("sessioncounter");
		sessioncounter++;
		session.setAttribute("sessioncounter", sessioncounter);
		//把application中的计数器+1
		applicationcounter = (Integer)application.getAttribute("applicationcounter");
		applicationcounter++;
		application.setAttribute("applicationcounter", applicationcounter);
	 %>
	 
	 <%
	 sessioncounter = (Integer)session.getAttribute("sessioncounter");
	 applicationcounter = (Integer)application.getAttribute("applicationcounter");
	  %>
	  
	  <br>session中的计数器：<%=sessioncounter %>
	  <br>application中的计数器：<%=applicationcounter %>
</body>
</html>